﻿using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Diagnostics;

namespace Medicalsystem.Update
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            if (Properties.Settings.Default.IsZipClient)
            {

                Application.Run(new FormZip());
            }
            else
            {
                FrmUpdate frm = new FrmUpdate();
                if (frm.CheckUpdate())
                {
                    Application.Run(frm);
                }
                else
                {
                    try
                    {

                        frm.RunMain(Application.StartupPath+"\\"+ Properties.Settings.Default.MainProcessFile);
                    }
                    catch
                    {
                        MessageBox.Show("文件不存在。");
                        Environment.Exit(11000);
                    }

                    Environment.Exit(10000);
                }
            }
        }
    }
}
